package com.lg.system.wxmaterial.service.impl;

import com.lg.system.wxmaterial.entity.WxMaterialArticle;
import com.lg.system.wxmaterial.dao.WxMaterialArticleDao;
import com.lg.system.wxmaterial.service.WxMaterialArticleService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import java.util.List;
import java.util.Date;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 图文消息 服务实现类
 * </p>
 *
 * @author dl
 * @since 2018-04-16
 */
@Transactional
@Service
public class WxMaterialArticleServiceImpl extends ServiceImpl<WxMaterialArticleDao, WxMaterialArticle> implements WxMaterialArticleService {

	
	public boolean save( WxMaterialArticle wxMaterialArticle) {
		wxMaterialArticle.setGmtCreate(new Date());
		return super.insert(wxMaterialArticle);
	}

	@Override
	public boolean update(WxMaterialArticle wxMaterialArticle) {
		wxMaterialArticle.setGmtModified(new Date());
		return super.updateById(wxMaterialArticle);
	}
	
	
	@Override
	public boolean deleteById(Long id) {
		return super.deleteById(id);
	}

	@Override
	public boolean deleteByIds(List<Long> ids) {
		if(null==ids||ids.isEmpty()){
			return false;
		}
		return super.deleteBatchIds(ids);
	}

}
